<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        let fruit = prompt('输入想要查询的水果');
        switch (fruit) {
            case '苹果':
                console.log('苹果2元一斤');
                break;
            case '香蕉':
                console.log('香蕉3元一斤');
                break;
            case '西瓜':
                console.log('西瓜4元一斤');
                break;
            default:
                console.log('店里没有此水果');
        }
        console.log('----------------------------结束-----------------------')
    </script>
</body>

</html>